﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CodeIn.Ui;
using CodeIn.Modules.Core;
using CodeIn.Core;
using CodeIn.Core.Modules;

namespace CodeIn.Modules.Ui.FileExplorer {
	public class FileExplorer : BaseModule {
		protected override void InitializeOverride() {
		}

		protected override bool CanExecuteOverride(string[] args) {
			return true;
		}

		protected override void ExecuteOverride(string[] args) {
			string path = OptionManager.Instance.GetValueFromName(Options.OPT_ENV_WORKINGDIRECTORY);

			UiHelper.CreateAndShowPanel("File explorer", PanelSide.TOPLEFT, () => {
				var view = new FileExplorerView();
				var vm = new FileExplorerViewModel();
				vm.NavigateToPath(path);
				view.DataContext = vm;
				return view;
			});
		}
	}
}
